package a.e.a;

import a.c.d;
import a.e.f;
import a.i.ib;
import a.i.jb;
import a.i.n;
import a.j.ab;
import a.j.c;
import a.j.fb;
import a.j.*;

import java.io.Externalizable;
import java.io.IOException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class e
  implements hb
{
  static Map a = new HashMap();
  public static boolean b;
  
  public void a(Object paramObject, g paramg)
    throws IOException
  {
    boolean bool = r.f;
    int i = r.e;
    tb localtb = (tb)paramObject;
    d locald = localtb.i();
    a.j.g localg = (a.j.g)locald.c();
    ld localld1 = localg.w(locald.e());
    ld localld2 = localg.w(locald.f());
    if (!bool) {
      if ((localtb instanceof ub))
      {
        paramg.b("type", "arc");
        if ((!bool) && (i == 0)) {
          break label630;
        }
      }
    }
    if (!bool) {
      if ((localtb instanceof zb))
      {
        paramg.b("type", "spline");
        if ((!bool) && (i == 0)) {
          break label630;
        }
      }
    }
    if (!bool) {
      if ((localtb instanceof vb))
      {
        paramg.b("type", "bezier");
        if ((!bool) && (i == 0)) {
          break label630;
        }
      }
    }
    if (!bool) {
      if ((localtb instanceof yb))
      {
        paramg.b("type", "quadCurve");
        paramg.a("quadCurveStraightness", ((yb)localtb).Z());
        if ((!bool) && (i == 0)) {
          break label630;
        }
      }
    }
    Object localObject3;
    if (!bool) {
      if ((localtb instanceof wb))
      {
        localObject1 = (wb)localtb;
        paramg.b("customconfiguration", ((wb)localObject1).ob());
        if (!bool) {
          if (((wb)localObject1).bb() != null) {
            try
            {
              String str = ib.c().a(((wb)localObject1).bb(), ((wb)localObject1).bb().getClass());
              paramg.b("userdataclass", ((wb)localObject1).bb().getClass().getName());
              paramg.b("userdata", str);
            }
            catch (Exception localException)
            {
              n.a("Could not write userdata " + ((wb)localObject1).bb() + " " + localException);
            }
          }
        }
        if (bool) {
          break label631;
        }
        localObject2 = ((wb)localObject1).ab();
        if (((Set)localObject2).size() <= 0) {
          break label630;
        }
        paramg.a("styleproperties");
        localObject3 = ((Set)localObject2).iterator();
        if (((Iterator)localObject3).hasNext()) {
          paramg.a("property");
        }
        label564:
        label570:
        while (bool)
        {
          localObject4 = (Map.Entry)((Iterator)localObject3).next();
          paramg.b("name", (String)((Map.Entry)localObject4).getKey());
          if (bool) {
            break label584;
          }
          if (i != 0) {
            break label582;
          }
          if ((bool) || (((Map.Entry)localObject4).getValue() != null))
          {
            Object localObject5 = ((Map.Entry)localObject4).getValue();
            jb localjb = ib.c().b(localObject5.getClass());
            if (!bool) {
              if (localjb != null)
              {
                paramg.b("valueClass", localObject5.getClass().getName());
                paramg.b("value", localjb.a(localObject5, localObject5.getClass()));
                if (bool) {
                  break label570;
                }
                if (i == 0) {
                  break label564;
                }
              }
            }
            if (!bool)
            {
              if ((localObject5 instanceof Externalizable)) {
                paramg.b("binaryValue", kb.a().a(localObject5, localObject5.getClass()));
              }
            }
            else
            {
              if (bool) {
                break label570;
              }
              if (i == 0) {
                break label564;
              }
            }
            n.a("Could not write style properties " + localObject5);
          }
          paramg.b();
          if (i == 0) {
            break;
          }
        }
        paramg.b();
        label582:
        label584:
        if (!bool) {
          if (i == 0) {
            break label630;
          }
        }
      }
      else
      {
        if (bool) {
          break label631;
        }
      }
    }
    if ((localtb instanceof xb))
    {
      localObject1 = (xb)localtb;
      if (bool) {
        break label631;
      }
      if (((xb)localObject1).Z()) {
        paramg.a("smoothBends", true);
      }
    }
    label630:
    label631:
    Object localObject1 = localtb.D();
    if (!bool) {
      if (((c)localObject1).getLineWidth() != 1.0F) {
        paramg.a("width", (int)((c)localObject1).getLineWidth());
      }
    }
    if (((c)localObject1).a() != 0) {
      paramg.b("style", b(((c)localObject1).a()));
    }
    if (!bool) {
      if (localtb.A() != null) {
        paramg.b("fill", f.a(localtb.A()));
      }
    }
    Object localObject2 = localtb.I();
    if (!bool)
    {
      if (localObject2 != ab.e)
      {
        localObject3 = a((ab)localObject2);
        paramg.b("sourceArrow", (String)localObject3);
      }
      if (!bool) {
        localObject2 = localtb.H();
      }
    }
    else if (localObject2 != ab.e)
    {
      localObject3 = a((ab)localObject2);
      paramg.b("targetArrow", (String)localObject3);
    }
    if (!bool) {
      if (localtb.z()) {
        paramg.a("reversedPathRendering", true);
      }
    }
    if (!bool)
    {
      if ((localtb instanceof ub))
      {
        localObject4 = (ub)localtb;
        paramg.b("arcType", a(((ub)localObject4).ab()));
        paramg.a("arcHeight", ((ub)localObject4).cb());
        paramg.a("arcRatio", ((ub)localObject4).bb());
      }
      if (bool) {}
    }
    else
    {
      if (localtb.n() <= 0) {
        return;
      }
      paramg.a("Line");
      paramg.a("point");
      paramg.a("x", localld1.A());
      paramg.a("y", localld1.B());
      paramg.b();
    }
    Object localObject4 = localtb.o();
    if (((fb)localObject4).e())
    {
      paramg.a("point");
      paramg.a("x", ((fb)localObject4).a().b());
      paramg.a("y", ((fb)localObject4).a().c());
    }
    for (;;)
    {
      if (!bool)
      {
        paramg.b();
        ((fb)localObject4).f();
        if (i == 0)
        {
          if (i == 0) {
            break;
          }
          paramg.a("point");
          paramg.a("x", localld2.A());
          paramg.a("y", localld2.B());
          if (bool) {
            continue;
          }
          paramg.b();
        }
      }
    }
    paramg.b();
  }
  
  public static String a(byte paramByte)
  {
    String str = "fixedRatio";
    if (paramByte == 0) {
      str = "fixedHeight";
    }
    return str;
  }
  
  public static String a(ab paramab)
  {
    boolean bool = r.f;
    String str = "standard";
    Object localObject = a.get(paramab);
    if ((bool) || (localObject != null))
    {
      if (bool) {
        break label57;
      }
      str = localObject.toString();
      if (r.e == 0) {}
    }
    else if ((bool) || (paramab.c() == 0))
    {
      str = paramab.d();
    }
    label57:
    return str;
  }
  
  public static String b(byte paramByte)
  {
    switch (paramByte)
    {
    case 0: 
      return "line";
    case 1: 
      return "dashed";
    case 2: 
      return "dotted";
    case 3: 
      return "dashed_dotted";
    }
    return "line";
  }
  
  static
  {
    a.put(ab.g, "delta");
    a.put(ab.f, "standard");
    a.put(ab.i, "diamond");
    a.put(ab.j, "short");
    a.put(ab.h, "white_delta");
    a.put(ab.k, "white_diamond");
    a.put(ab.e, "none");
    a.put(ab.l, "plain");
    a.put(ab.m, "concave");
    a.put(ab.n, "convex");
    a.put(ab.o, "circle");
    a.put(ab.p, "transparent_circle");
    a.put(ab.q, "dash");
    a.put(ab.r, "skewed_dash");
    a.put(ab.s, "t_shape");
    a.put(ab.v, "crows_foot_one_optional");
    a.put(ab.w, "crows_foot_many_optional");
    a.put(ab.t, "crows_foot_one_mandatory");
    a.put(ab.u, "crows_foot_many_mandatory");
    a.put(ab.x, "crows_foot_one");
    a.put(ab.y, "crows_foot_many");
    a.put(ab.z, "crows_foot_optional");
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.a.e

 * JD-Core Version:    0.7.0.1

 */